{layout name="common/layout" /}
{css href="__PUBLIC__/admin/js/bootstrap-daterangepicker/daterangepicker.css"}
{js href="__PUBLIC__/admin/js/bootstrap-daterangepicker/moment.min.js,__PUBLIC__/admin/js/bootstrap-daterangepicker/daterangepicker.js" /}
<section class="panel">
    <header class="panel-heading">
        客服列表 <span class="label label-default">{$customcount}人</span><a class="btn btn-default tools pull-right" href="javascript:location.reload();"><span class="fa fa-refresh"></span></a>
    </header>
    <div class="panel-body">
        <div class="adv-table">
            <div id="dynamic-table_wrapper" class="dataTables_wrapper form-inline" role="grid">
                <div class="row">
                    <div class="col-xs-4 btn-group">
                        <a class="btn btn-default disabled" role="operate" data-type="1" data-url="{:WebUrl('adminmember/delmember')}"><i class="fa fa-trash-o"></i> 删除客服</a>
                        <a class="btn btn-default disabled"  role="operate" data-type="2" data-url="{:WebUrl('adminmember/operatemember',array('is_black'=>1))}"><i class="fa fa-circle"></i> 拉黑客服</a>
                        <a class="btn btn-default disabled"  role="operate" data-type="3" data-url="{:WebUrl('adminmember/operatemember',array('is_black'=>0))}"><i class="fa fa-circle-o"></i> 取消拉黑</a>
                    </div>
                    <div class="col-xs-4 pull-right">
                        <form method="get">
                            <input type="text" name="key" class="form-control" placeholder="姓名" value="{php}if(!empty($key)){echo $key;}{/php}">
                            <button type="submit" class="btn btn-default ">搜索</button>
                        </form>
                    </div>

                </div>
                <hr/>

                {php} if(!empty($customcount)){ {/php}
                <table class="table">
                    <thead>
                    <tr role="row">
                        <th><input type="checkbox" value=""></th>
                        <th>客服昵称(真实姓名)</th>
                        <th>帐号(手机)</th>
                        <th>分组</th>
                        <th>状态</th>
                        <th>最近登录</th>
                        <th>操作</th>
                    </tr>
                    </thead>
                    <tbody >
                    {volist name='customlist' id='member'}

                    <tr role="pop" data-title="客服ID:{$member['seller_id']}" data-content="">
                    <td><input type="checkbox" value="{$member['seller_id']}"></td>
                    <td><img src="{:toHeadurl($member['seller_avatar'])}" class="img-circle " width="40px" height="40px"> {:substr($member['seller_name'],0,20)}({:substr($member['seller_truename'],0,20)})</td>
                    <td>{$member['seller_tel']}</td>
                    <td>
                        <p>{$member['seller_group_id']}</p>
                    </td>
                    <td>
                        <p>{php}if($member['status']){echo '<span class="label label-primary">正常</span>';}else{echo '<span class="label label-default">已拉黑</span>';}{/php}</p>
                    </td>
                    <td>
                        {:date('Y-m-d',$member['last_login_time'])}
                    </td>
                    <td>
                        <div class="btn-group">
                            <button type="button" class="btn btn-default dropdown-toggle" data-toggle="dropdown">
                                操作 <span class="caret"></span>
                            </button>
                            <ul class="dropdown-menu" role="menu">
                                <li><a href="javascript:void(0);"><i class="fa fa-pencil-square-o"></i> 客服编辑</a></li>
                                <li><a href="javascript:void(0);"><i class="fa fa-trash-o"></i> 删除客服</a></li>
                            </ul>
                        </div>
                    </td>
                    </tr>
                    {/volist}
                    </tbody>
                </table>
                <div class="row-fluid">
                    <div class="span6 pull-right">
                        {$customlist->render()}
                    </div>
                </div>
                {php} }else{ {/php}
                <div class="row text-center">暂无用户....</div>
                {php} } {/php}

            </div>
        </div>
    </div>
</section>
<script type="text/javascript">
    $(document).ready(function () {
        dateInit('input[name="membertime"]','input[name="start_time"]','input[name="end_time"]');
        $('[role="operate"]').click(function () {
            var title = $(this).data('title');
            if(title){
                title = '您确认要执行此'+title+'操作吗？'
            }else{
                title = '您确认要执行此操作吗？'
            }
            $.confirm({
                icon:'fa fa-warning',
                title: '提醒',
                content: title ,
                buttons: {
                    ok: {
                        text: "确认",
                        btnClass: 'btn-success',
                        keys: ['enter'],
                        action: function(){
                            $.alert('dfdfdsf');
                            console.log('ok');
                        }
                    },
                    no:{
                        text: "取消",
                        btnClass: 'btn-default',
                        keys: ['enter'],
                        action: function(){
                            console.log('no');
                        }
                    },
                }
            });
        });
    });
</script>
